import App from '@/App';

import { createHashRouter, Navigate, RouteObject } from 'react-router-dom';
import { lazy } from 'react';
const Discover = lazy(() => import('@/views/discover'));
const Focus = lazy(() => import('@/views/focus'));
const Mine = lazy(() => import('@/views/mine'));
const Ranking = lazy(() => import('@/views/discover/c-views/ranking'));
const Recommend = lazy(() => import('@/views/discover/c-views/recommend'));
const Songlist = lazy(() => import('@/views/discover/c-views/songlist'));

const routers: RouteObject[] = [
    {
        path: '/',
        element: <Navigate to="/discover"></Navigate>,
    },
    {
        path: '/discover',
        element: <Discover />,
        children: [
            {
                path: '/discover',
                element: <Navigate to="/discover/recommend"></Navigate>,
            },
            {
                path: '/discover/ranking',
                element: <Ranking />,
            },
            {
                path: '/discover/songs',
                element: <Songlist />,
            },
            {
                path: '/discover/recommend',
                element: <Recommend />,
            },
        ],
    },
    {
        path: '/discover',
        element: <Discover />,
    },
    {
        path: '/mine',
        element: <Mine />,
    },
    {
        path: '/focus',
        element: <Focus />,
    },
];
export default routers;
